#!/usr/bin/env python
# -*- coding: utf-8 -*-
import  xml.dom.minidom
import os 
import sys
#两个参数，第一个是查找的xml文件，第二个是查找的关键字
search = sys.argv[1]
search =search.decode('utf-8')
filename = sys.argv[2]
dom = xml.dom.minidom.parse(filename)
root = dom.documentElement
aaa=[]
moviename = root.getElementsByTagName('a')
movieid = root.getElementsByTagName('b')
#movietag = root.getElementsByTagName('c')
#director = root.getElementsByTagName('d')
#dsjtype = root.getElementsByTagName('e')
#moviefrom = root.getElementsByTagName('f')
#movietype = root.getElementsByTagName('g')
#copuright = root.getElementsByTagName('h')
#updatedate = root.getElementsByTagName('v')
moviedetal = root.getElementsByTagName('ff')
#call = root.getElementsByTagName('yd')
#call = root.getElementsByTagName('ydd')
for a in range(len(moviename)):
    	if moviename[a].firstChild.data.find(search) != -1 or moviedetal[a].firstChild.data.find(search) != -1:
			aaa.append (a)
print aaa
